<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<style type="text/css">
	.ls{
		background: green;
		color: white;
	}
</style>
<script type="text/javascript">
	// document.write('abc');
	// document.write('a');
	// document.write('b');
	// document.write('c');
	var rows = prompt('请输入行数');//行数
	var cols = prompt('请输入列数');//列数
	
	document.write('<table border="1">');

	for(var i=1;i<=rows;i++){
		if(i%2==1){//判断当前是奇数行
			document.write('<tr class="ls">');//如果是奇数行，输出的tr就带class
		}else{
			document.write('<tr>');
		}
		
		for(var j=1;j<=cols;j++){
			document.write('<td>第'+i+'行第'+j+'列</td>');
		}
		document.write('</tr>');
	}

	document.write('</table>');
</script>
</head>

<body>

<!-- 后盾网 人人做后盾 -->
<!-- <table border="1"> -->
	<!-- tr*5>td{后盾网}*6 -->
<!-- 	<tr>
		<td>后盾网</td>
		<td>后盾网</td>
		<td>后盾网</td>
		<td>后盾网</td>
		<td>后盾网</td>
		<td>后盾网</td>
	</tr>
	<tr>
		<td>后盾网</td>
		<td>后盾网</td>
		<td>后盾网</td>
		<td>后盾网</td>
		<td>后盾网</td>
		<td>后盾网</td>
	</tr>
	<tr>
		<td>后盾网</td>
		<td>后盾网</td>
		<td>后盾网</td>
		<td>后盾网</td>
		<td>后盾网</td>
		<td>后盾网</td>
	</tr>
	<tr>
		<td>后盾网</td>
		<td>后盾网</td>
		<td>后盾网</td>
		<td>后盾网</td>
		<td>后盾网</td>
		<td>后盾网</td>
	</tr>
	<tr>
		<td>后盾网</td>
		<td>后盾网</td>
		<td>后盾网</td>
		<td>后盾网</td>
		<td>后盾网</td>
		<td>后盾网</td>
	</tr>
</table> -->



</body>
</html>
